package com.honglv.config;


import com.honglv.properties.AliOssProperties;
import com.honglv.utils.AliOssUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Description:这是一个配置类，负责在项目开始时创建AliOssUtil对象供调用
 * date: 2023/09/15
 * author:王铭杰
 */
@Configuration
@Slf4j
public class OssConfig {
    @Bean
    public AliOssUtil aliOssUtil(AliOssProperties aliOssProperties){
        log.info("开始创建阿里云文件上传工具类对象：{}",aliOssProperties);
        return new AliOssUtil(aliOssProperties.getEndpoint(), aliOssProperties.getAccessKeyId(), aliOssProperties.getAccessKeySecret(), aliOssProperties.getBucketName());
    }

}
